package com.yoga.api;
import com.yoga.service.impl.AiService;
import com.yoga.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author yan
 * @date 2025/8/30
 */

@RestController
@RequestMapping(value = "/api/v1/ai")
public class AiController {

    private AiService aiService;
    @Autowired
    public void setAiService(AiService aiService) {
        this.aiService = aiService;
    }
    @PostMapping("/generateRemark")
    public ResponseEntity<JsonResult<String>> generateRemark(@RequestBody Map<String, String> body) {
        String keywords = body.get("keywords");
        String remark = aiService.generateRemark(keywords);
        return ResponseEntity.ok(JsonResult.success(remark));
    }
}

